{include file="index@public/header" /}
<style>
  body {
    background: #e1e0de;
  }
  * {
    box-sizing: border-box;
  }
  h1,
  h2,
  h3,
  h4 {
    font-weight: 700 !important;
  }
  .layui-card-header {
    width: 77%;
    border-bottom: 1px solid #999 ;
    padding-left: 5px;
    height: auto;
  }
  .layui-card {
    width: 1200px;
    padding: 10px 20px 50px;
  }
  p {
    margin: 0 0 10px !important;
  }
  .layui-container {
    padding: 0 !important;
  }
  img {
    max-width: 100%;
  }
  ::-moz-selection {
    background: #cccccc;
    color: #ffffff;
  }
  ::selection {
    background: #cccccc;
    color: #ffffff;
  }
  .layui-breadcrumb {
    padding-left: 5px;
  }
  .layui-card h1 {
    margin: 10px auto 0;
  }
  .description {
    font-size: 15px;
    font-weight: bold;
    margin: 20px 0;
  }

  .layui-textarea {
    resize: none !important;
  }
  .layui-card-body{
    padding: 10px 5px;
  }
  .layui-card-body .layui-row .layui-col-sm9 {
    margin: revert;
    padding: revert;
    list-style: unset;
  }
  .date{ font-style:italic;color:black;color:#666;;}
  .but{background-color: #0073b1!important;border: 0!important;
    border-radius: 2px!important;
    box-sizing: border-box!important;
    color: #fff!important;
    cursor: pointer!important;
    display: inline-block!important;
    height: 23px;}
  .but:hover,.but:hover a{
    background-color: #08525f !important;
  }
  .guding{
    zoom:1;
    clear:both;
    position:fixed;
    _position:absolute;
    z-index:10;
  }
  .mycontent{
    font: 12px/14px arial,helvetica,sans-serif;
    width: 1400px;
    position: relative;
    display: flex;
  }
  .right-content2{
    width:22%;
    padding: 10px 10px;
    float: right;
  }

  .right-content1{
    width:78%;
    padding: 10px 10px;
    float: right;
  }
  .left-content a{
    text-decoration: none;
    display: block;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
    color: #333;
    cursor: pointer;
    white-space: pre-wrap;
    transition: all .33s ease-out;
    overflow-wrap: break-word;
    background-color: transparent;
  }
  .left-content a:hover{
    color: #157BFB;
    background: rgba(5,74,218,.06);
  }
  .left-content ul li {
    position: relative;
    padding: 4px 8px 4px 32px;
    line-height: 20px;
    min-height: 35px;
  }
  .left-content{
    width: 250px;
    background-color: white;
  }
  @media screen and (max-width: 800px) {
    .layui-card-header {
      line-height: normal !important;
      font-size: 10px !important;
    }

    .guding, .right-content2 {
      display: none;
    }

    .right-content1 {
      width: 100%;
    }
  }

</style>
<div class="layui-container mycontent">

  <div class="left-content">
    <div class="archives guding" style="width: 250px;z-index: 10;position: sticky;border: none;padding:20px;background-color: white;top:150px;">
      <h3 style="padding:5px 15px;text-align:left;">{:lang('CONTENTS')}</h3>
      <div style="clear: both;"></div>
      <ul class="archives-ul">
        {:htmlspecialchars_decode($miaocontent)}

      </ul>
    </div>
  </div>


  <div class="layui-card" style="flex:1">
    <span class="layui-breadcrumb" lay-separator="/">
      <a href="/" style='font: 12px/14px arial,helvetica,sans-serif;'>{:lang('Home')}</a>
      {foreach $crumbs as $k=>$v }
      <a href="/{$v['crumbs_url']}" style="font: 12px/14px arial,helvetica,sans-serif;color:#36648A">{$v['alias_name']}</a>
      {/foreach}
      <a style='font: 12px/14px arial,helvetica,sans-serif;color:#333'><cite>{$title}</cite></a>
    </span>

    <div class="layui-card-header">
      <h1>{$title}</h1>
    </div>


    <div class="layui-card-body" style='color: #333;line-height: 24px;'>
      <div class='date'>{:lang('Release time')} : {$create_time}</div>

      <div class="layui-row ">
        <div class="layui-col-sm2 right-content2 guding" style="z-index: 10;position: sticky;top: 150px;margin-top: -60px;">
          <div class="archives author" style="margin:10px 0px;padding:10px 24px;">
            <div style="padding-left: 20px;" >
              <img src="{:Config::get('app.images_host')}{$author['img']}" style="width: 85px;height: 85px;border-radius: 85px;" />
            </div>
            <h3 style="padding-left: 20px;">{$author['nickname']}</h3>
            <p>{$author['intro']}</p>

          </div>

          <div class="archives" style="margin:10px 0px;padding:10px 24px;">
            <h3 >{:lang("Share this article")}</h3>
            <?php if(config('app.default_lang')=='en-us'){?>

            <a href="https://www.linkedin.com/shareArticle?mini=true&url={:urlencode($url)}&title={:urlencode($title)}" title="{:urlencode($title)}" target="blank" rel="nofollow"><img src="{:Config::get('app.images_host')}/images/web/sharein.png?t={:time()}" style="width: 40px;height: 40px;" /></a>
            <a href="http://www.facebook.com/sharer.php?u={:urlencode($url)}&t={:urlencode($title)}" title="{:urlencode($title)}" target="blank" rel="nofollow"><img src="{:Config::get('app.images_host')}/images/web/shareface.png?t={:time()}&media={$cover}" style="width: 40px;height: 40px;" /></a>
            <a href="http://twitter.com/share?url={:urlencode($url)}&image={$cover}&text={:urlencode($title)}" target="blank" rel="nofollow">
              <img src="{:Config::get('app.images_host')}/images/web/sharetwitter.png?t={:time()}" style="width: 40px;height: 40px;" />
            </a>
            <?php }?>

          </div>
          <div class="archives" style="margin:10px 0px;padding:10px 24px;">
            <h3 >{:lang("Subscribe to learn more about Bearings")}</h3>
            <div class="layui-input-block" style="float:left;width:100%;height:40px;margin-top: 10px;">
              <input type="text" name="subscribe_email2" placeholder="{:lang('Enter Your Email')}" autocomplete="off" class="layui-input" />
            </div>

            <button id='gform_submit_button_8' class="layui-btn tijiao" lay-filter="subscribe_formDemo2"
                    lay-submit type='button' style="color:black;background-color: #f7c542;width:100%;margin-top: 10px;">{:lang('Subscribe')}</button>
          </div>



          <?php if($id==151){?>
          <div class="archives" style="margin:10px 0px;border: 1px solid #D3D4D8;padding:24px;">
            <div>
              <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Bore Dia')}</div>
              <div style="padding: 2px 5px">
                <div style="padding-bottom:5px;padding-top:5px" >
                  <select style='cursor:pointer;width:100%;height:30px' name="Bore_Dia" id='Bore_Dia_angular' onchange="Bore_Diasel()">
                    <option value="">{:lang('Please choose')}...</option>
                    {foreach $Bore_Dia as $key=>$vo }
                    <option value="<?php echo str_replace('"','\"',$vo['Bore_Dia']);?>">{$vo['Bore_Dia']}</option>
                    {/foreach}
                  </select>
                </div>
              </div>
            </div>

            <div>
              <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Outer Dia')}</div>
              <div style="padding: 2px 5px">
                <div style="padding-bottom:5px;padding-top:5px" >
                  <select style='cursor:pointer;width:100%;height:30px' name="Outer_Dia" id='Outer_Dia_angular' onchange="Bore_Diasel()">
                    <option value="">{:lang('Please choose')}...</option>
                    {foreach $Outer_Dia as $key=>$vo }
                    <option value="<?php echo str_replace('"','\"',$vo['Outer_Dia']);?>">{$vo['Outer_Dia']}</option>
                    {/foreach}
                  </select>
                </div>
              </div>
            </div>

            <div>
              <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Width')}</div>
              <div style="padding: 2px 5px">
                <div style="padding-bottom:5px;padding-top:5px">
                  <select style='cursor:pointer;width:100%;height:30px' name="Width" id='Width_angular' onchange="Bore_Diasel()">
                    <option value="">{:lang('Please choose')}...</option>
                    {foreach $Width as $key=>$vo }
                    <option value="<?php echo str_replace('"','\"',$vo['Width']);?>">{$vo['Width']}</option>
                    {/foreach}
                  </select>
                </div>
              </div>
            </div>
            <div style="margin-left:35%">
              <button class="layui-btn layui-btn-sm" onclick='chuandi2()' style="background-color: #FDD702;color:black;font-weight:bold;">{:lang('SEARCH')}</button>

            </div>
          </div>
          <?php }?>
        </div>
        <div class="layui-col-sm9 right-content1">
          {:htmlspecialchars_decode($content)}
          <?php if($id==2180){?>
          <div class="archives"  style="width:50%;padding: 10px 10px;float: left;">
            <div style="">
              <div style="border:1px solid black;width:80%;margin-left:10%;padding: 10px 10px;border-radius:5px">
                <div>
                  <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Bore Diameter')}<span
                          style="color:#36648a;font-size:18px">*</span>:</div>
                  <div style="padding: 2px 5px">
                    <div style="padding-bottom:5px;padding-top:5px">
                      <input style='cursor:text;width:70%;height:30px'  type="text" id="Bore_Diameter" name="Bore_Diameter">mm
                    </div>
                  </div>
                </div>

                <div>
                  <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Outer Diameter')}<span
                          style="color:#36648a;font-size:18px">*</span>:</div>
                  <div style="padding: 2px 5px">
                    <div style="padding-bottom:5px;padding-top:5px">
                      <input style='cursor:text;width:70%;height:30px' type="text" id="Outer_Diameter" name="Outer_Diameter">mm
                    </div>
                  </div>
                </div>
                <div>
                  <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('n')}<span
                          style="color:#36648a;font-size:18px">*</span>:</div>
                  <div style="padding: 2px 5px">
                    <div style="padding-bottom:5px;padding-top:5px">
                      <input style='cursor:text;width:70%;height:30px' type="text" id="n" name="n">min<sup>-1</sup>
                    </div>
                  </div>
                </div>
                <div>
                  <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Pr')}<span
                          style="color:#36648a;font-size:18px">*</span>:</div>
                  <div style="padding: 2px 5px">
                    <div style="padding-bottom:5px;padding-top:5px">
                      <input style='cursor:text;width:70%;height:30px' type="text" id="Pr" name="Pr">N
                    </div>
                  </div>
                </div>
                <div>
                  <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('Cr')}<span
                          style="color:#36648a;font-size:18px">*</span>:</div>
                  <div style="padding: 2px 5px">
                    <div style="padding-bottom:5px;padding-top:5px">
                      <input style='cursor:text;width:70%;height:30px' type="text" id="Cr" name="Cr">N
                    </div>
                  </div>
                </div>
                <div>
                  <div style="font-weight:bold;background-color:#EFEFEF;padding:5px;border-radius:2px">{:lang('T')}<span
                          style="color:#36648a;font-size:18px">*</span>:</div>
                  <div style="padding: 2px 5px">
                    <div style="padding-bottom:5px;padding-top:5px">
                      <input style='cursor:text;width:70%;height:30px' type="text" id="T" name="T">°C
                    </div>
                  </div>
                </div>
                <div style="padding:5px;">
                  <div>{:lang('(For single-row deep groove ball bearings only)')}</div>
                  <button class="layui-btn layui-btn-sm" onclick='chuandi()' style="background-color: #FDD702;color:black;font-weight:bold;">{:lang('calculate')}</button>
                  <div id="result"></div>
                </div>


              </div>

            </div>
          </div>
          <?php }?>
          <div style="clear: both;"></div>
          <p style="font-size: 48px;color: rgb(23, 26, 34);margin-top: 60px !important;">{:lang('Keep Learning')}</p>
          <ul style="margin-top:30px;display: flex;flex-wrap: wrap;">
            {volist name="$last" id="data" length="4"}
            <li style="width: calc(100% / 2);margin-top: 10px;padding:10px;">
              <a href="/{:end($crumbs)['crumbs_url']}{$data['url']}/" style="text-decoration: none">
                <p class="title" style="font-size: 22px;line-height: 1.28;height:30%">{$data['title']}</p>
                <p class="intro" style="font-size: 16px;line-height: 1.65;color: rgb(62, 66, 75);margin-top: 8px;height:50%">
                  <?php
                  if($data['miaodian']){
                      $data['content']=str_replace(explode("</p>",htmlspecialchars_decode($data['content']))[0],"",$data['content']);
                  }
                  if(config('app.default_lang')=='zh-cn'){?>
                  {:strip_tags(mb_substr($data['content'],0,200))}
                  <?php }else{?>
                  {:strip_tags(substr($data['content'],0,200))}
                  <?php }?>
                </p>
                <p class="author" style="font-size: 14px;line-height: 1.5;margin-top: 8px;"><a href="/blog/author/{:str_replace(' ','-',strtolower($author['nickname']))}/" style="text-decoration: none">{$author['nickname']}</a></p>
              </a>
            </li>
            {/volist}
          </ul>
        </div>
      </div>
    </div>
  </div>
</div>
{include file="/public/footer" /}
<script type="text/javascript">
  function chuandi(){
    var Bore_Diameter = $.trim($("input[name='Bore_Diameter']").val());
    if(Bore_Diameter === "" || Bore_Diameter ==null || Bore_Diameter==0){
      layer.tips('Please fill in the Bore_Diameter', '#Bore_Diameter', {
        tips: [4, '#5FB878'],
      });
      document.getElementById("Bore_Diameter").focus();
      return false;
    }
    var Outer_Diameter = $.trim($("input[name='Outer_Diameter']").val());
    if(Outer_Diameter === "" || Outer_Diameter ==null || Outer_Diameter==0){
      layer.tips('Please fill in the Outer_Diameter', '#Outer_Diameter', {
        tips: [4, '#5FB878'],
      });
      document.getElementById("Outer_Diameter").focus();
      return false;
    }
    var n = $.trim($("input[name='n']").val());
    if(n === "" || n ==null || n==0){
      layer.tips('Please fill in the n', '#n', {
        tips: [4, '#5FB878'],
      });
      document.getElementById("n").focus();
      return false;
    }
    var Pr = $.trim($("input[name='Pr']").val());
    if(Pr === "" || Pr ==null || Pr==0){
      layer.tips('Please fill in the Pr', '#Pr', {
        tips: [4, '#5FB878'],
      });
      document.getElementById("Pr").focus();
      return false;
    }
    var Cr = $.trim($("input[name='Cr']").val());
    if(Cr === "" || Cr ==null || Cr==0){
      layer.tips('Please fill in the Cr', '#Cr', {
        tips: [4, '#5FB878'],
      });
      document.getElementById("Cr").focus();
      return false;
    }
    var T = $.trim($("input[name='T']").val());
    if(T === "" || T ==null || T==0){
      layer.tips('Please fill in the T', '#T', {
        tips: [4, '#5FB878'],
      });
      document.getElementById("T").focus();
      return false;
    }else if(T >120){
      layer.tips('T >120,Please contact with your bearing manufacturer', '#T', {
        tips: [4, '#5FB878'],
      });
      return false;
    }

    var res='';
    var p='';
    var dn='';
    p=Pr/Cr;
    dn=(parseFloat(Bore_Diameter)+parseFloat(Outer_Diameter))/2*n;
    if(T < 50){
      T=50;
    }
    if(p < 0.04){
      p=0.04;
    }
    if(p >0.16){
      layer.tips('Pr/Cr>0.16,Please contact with your bearing manufacturer', '#Pr', {
        tips: [4, '#5FB878'],
      });
      return false;
    }

    if(dn <125000){
      dn=125000;
    }
    if(dn >500000){
      layer.tips('d<sub>m</sub>n does not comply with regulations,Please contact with your bearing manufacturer', '#Bore_Diameter', {
        tips: [4, '#5FB878'],
      });
      return false;
    }
    res=6.10-4.40*Math.pow(10,-6)*dn-3.125*(p-0.04)-(0.021-1.80*Math.pow(10,-8)*dn)*T;
    res=Math.pow(10,res);
    document.getElementById("result").innerHTML='<input disabled="true" style="margin-top:10px;width:70%;height:30px" type="text" value="L='+res.toFixed(2)+ '（h)">';
  }

  function init_selected(){
    $("#Bore_Dia_angular option:selected").prop('selected', false);
    $("#Outer_Dia_angular option:selected").prop('selected', false);
    $("#Width_angular option:selected").prop('selected', false);
    Bore_Diasel()
  }
  function Bore_Diasel(){
    var Bore_Dia   = $("#Bore_Dia_angular option:selected").val();
    var Outer_Dia  = $("#Outer_Dia_angular option:selected").val();
    var Width      = $("#Width_angular option:selected").val();
    Bore_Dia=Bore_Dia.replace("\\","\"");
    Outer_Dia=Outer_Dia.replace("\\","\"");
    Width=Width.replace("\\","\"");

    var formData = new FormData();
    formData.append('Bore_Dia', Bore_Dia);
    formData.append('Outer_Dia', Outer_Dia);
    formData.append('Width', Width);
    $.ajax({
      url: "{:url('index/News/needle_bearings_search_Outer')}",/*传向后台服务器文件*/
      type: 'POST',    /*传递方法 */
      data: formData,  /*要带的值，在这里只能带一个formdata ，不可以增加其他*/
      dataType: 'json',  //传递数据的格式
      async: true, //这是重要的一步，防止重复提交的
      cache: false,  //设置为false，上传文件不需要缓存。
      contentType: false,//设置为false,因为是构造的FormData对象,所以这里设置为false。
      processData: false,//设置为false,因为data值是FormData对象，不需要对数据做处理。

      success: function (res){
        // 内径
        var Bore_Dia_html='<option value="">Please choose...</option>';

        for(var i=0;i<res.Bore_Dia.length;i++){
          var selected = res.Bore_Dia[i]['Bore_Dia'] == Bore_Dia ? 'selected':'';
          Bore_Dia_html+="<option "+ selected +" value='"+res.Bore_Dia[i]["Bore_Dia"]+"'>"+res.Bore_Dia[i]["Bore_Dia"]+"</option>";
        }
        $("#Bore_Dia_angular").html(Bore_Dia_html);

        // 外径
        var Outer_Dia_html='<option value="">Please choose...</option>';
        for(var i=0;i<res.Outer_Dia.length;i++){
          var selected = res.Outer_Dia[i]['Outer_Dia'] == Outer_Dia ? 'selected':'';
          Outer_Dia_html+="<option "+ selected +" value='"+res.Outer_Dia[i]["Outer_Dia"]+"'>"+res.Outer_Dia[i]["Outer_Dia"]+"</option>";
        }
        $("#Outer_Dia_angular").html(Outer_Dia_html);

        // 宽度
        var Width_html='<option value="">Please choose...</option>';
        for(var i=0;i<res.Width.length;i++){
          var selected = res.Width[i]['Width'] == Width ? 'selected':'';
          Width_html+="<option "+ selected +" value='"+res.Width[i]["Width"]+"'>"+res.Width[i]["Width"]+"</option>";
        }
        $("#Width_angular").html(Width_html);
      }
    });
  }


  function chuandi2(){

    var Bore_Dia=$("#Bore_Dia_angular option:selected").val();
    var Outer_Dia=$("#Outer_Dia_angular option:selected").val();
    var Width=$("#Width_angular option:selected").val();
    var url="/roller-bearings/needle-roller-bearings/";
    var str=url+"?";
    if(Bore_Dia!=''&&Bore_Dia!=undefined){
      str+="Bore_Dia="+Bore_Dia;
    }
    if(Outer_Dia!=''&&Outer_Dia!=undefined){
      str+="&Outer_Dia="+Outer_Dia;
    }
    if(Width!=''&&Width!=undefined){
      str+="&Width="+Width;
    }
    window.location.href=str;


  }
</script>
<script type="text/javascript">
  layui.use('form', function(){
    var form = layui.form;

    form.on('submit(subscribe_formDemo2)', function(data){
      var email=$.trim($("input[name='subscribe_email2']").val());
      var formData = new FormData();
      formData.append('email', email);

      $.ajax({
        url: "{:url('index/xunpan/subscribe_email')}",/*传向后台服务器文件*/
        type: 'POST',    /*传递方法 */
        data: formData,  /*要带的值，在这里只能带一个formdata ，不可以增加其他*/
        dataType: 'json',  //传递数据的格式
        async: true, //这是重要的一步，防止重复提交的
        cache: false,  //设置为false，上传文件不需要缓存。
        contentType: false,//设置为false,因为是构造的FormData对象,所以这里设置为false。
        processData: false,//设置为false,因为data值是FormData对象，不需要对数据做处理。

        success: function (res){
          if(res.status==1){
            layer.closeAll('loading');
            $(".layui-form input").each(function(){
              $(this).val('');
            })
            layer.msg(res.msg,{time:2000,icon: 1},function(){
              //location.href="/thank-you/";
            });
            return false;
          }else{
            layer.msg(res.msg,{time:2000,icon: 5});
            layer.closeAll('loading');
            return false;
          }
        }
      });

      return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });
  })
</script>